home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / w3 / w3-latex.elc.z / w3-latex.elc (.txt)
Encoding:
LaTeX Document  |  1998-05-21  |  8.5 KB  |  81 lines

  1. ;;; compiled by justinb@ebony.cray.com on Mon Mar  9 13:07:16 1998
  2. ;;; from file /home/aspen07/justinb/roots/freeware/xemacs/20.3/xemacs-20.3/lisp/w3/w3-latex.el
  3. ;;; emacs version 20.4 "Emerald" XEmacs  Lucid.
  4. ;;; bytecomp version 2.25 XEmacs; 22-Mar-96.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs 19.
  7. (if (and (boundp 'emacs-version)
  8.      (or (and (boundp 'epoch::version) epoch::version)
  9.          (string-lessp emacs-version "20")))
  10.     (error "`w3-latex.el' was compiled for Emacs 20"))
  11. (or (boundp 'current-load-list) (setq current-load-list nil))
  12. (byte-code "
  13. " [require w3-cus w3-print] 2)
  14. #@28 What URL we are formatting
  15. (defvar w3-latex-current-url nil (#$ . 651))
  16. #@45 Whether we are in a {verbatim} block or not
  17. (defvar w3-latex-verbatim nil (#$ . 729))
  18. #@33 List of links for endnote usage
  19. (defvar w3-latex-links-list nil (#$ . 821))
  20. #@67 Defines mappings between `w3-html-entities' and LaTeX characters.
  21. (defvar w3-latex-entities '((nbsp . "~") (iexcl . "!`") (pound . "\\pounds ") (brvbar . "|") (sect . "\\S") (uml . "\\\"{ }") (copy . "\\copyright ") (laquo . "$\\ll$") (not . "\\neg") (shy . "-") (reg . "(R)") (macr . "\\={ }") (deg . "$\\deg$") (plusmn . "$\\pm$") (sup2 . "$^{2}$") (sup3 . "$^{3}$") (acute . "\\'{ }") (micro . "$\\mu$") (para . "\\P ") (middot . "$\\cdot$") (cedil . "\\c{ }") (sup1 . "$^{1}$") (raquo . "$\\gg$") (frac14 . "$
  22. rac{1}{4}$") (frac12 . "$
  23. rac{1}{2}$") (frac34 . "$
  24. rac{3}{4}$") (iquest . "?`") (Agrave . "\\`{A}") (Aacute . "\\'{A}") (Acirc . "\\^{A}") (Atilde . "\\~{A}") (Auml . "\\\"{A}") (Aring . "\\AA ") (AElig . "\\AE ") (Ccedil . "\\c{C}") (Egrave . "\\`{E}") (Eacute . "\\'{E}") (Ecirc . "\\^{E}") (Euml . "\\\"{E}") (Igrave . "\\`{I}") (Iacute . "\\'{I}") (Icirc . "\\^{I}") (Iuml . "\\\"{I}") (Ntilde . "\\~{N}") (Ograve . "\\`{O}") (Oacute . "\\'{O}") (Ocirc . "\\^{O}") (Otilde . "\\~{O}") (Ouml . "\\\"{O}") (times . "$\\times$") (Oslash . "\\O") (Ugrave . "\\`{U}") (Uacute . "\\'{U}") (Ucirc . "\\^{U}") (Uuml . "\\\"{U}") (Yacute . "\\'{Y}") (szlig . "\\ss ") (agrave . "\\`{a}") (aacute . "\\'{a}") (acirc . "\\^{a}") (atilde . "\\~{a}") (auml . "\\\"{a}") (aring . "\\aa ") (aelig . "\\ae ") (ccedil . "\\c{c}") (egrave . "\\`{e}") (eacute . "\\'{e}") (ecirc . "\\^{e}") (euml . "\\\"{e}") (igrave . "\\`{i}") (iacute . "\\'{i}") (icirc . "\\^{i}") (iuml . "\\\"{i}") (ntilde . "\\~{n}") (ograve . "\\`{o}") (oacute . "\\'{o}") (ocirc . "\\^{o}") (otilde . "\\~{o}") (ouml . "\\\"{o}") (divide . "$\\div$") (oslash . "\\o") (ugrave . "\\`{u}") (uacute . "\\'{u}") (ucirc . "\\^{u}") (uuml . "\\\"{u}") (yacute . "\\'{y}") (yuml . "\\\"{y}")) (#$ . 903))
  25. (defalias 'w3-latex-replace-entities #[(str) "
  26. " [0 start string-match "[
  27. ]" str rassq w3-html-entities match w3-latex-entities replace replace-match t] 6])
  28. (defalias 'w3-latex-insert-string #[(str) "
  29. " ["\\\\" "-BaCkSlAsH-" "[%&#_{}$]" "\\\\\\&" "\\^" "{\\\\textasciicircum}" "~" "{\\\\textasciitilde}" "[*]" "{\\&}" "[><|]" "$\\&$" "$\\\\backslash$" todo w3-latex-verbatim append (("\n" . "\\\\newline\\\\nullspace\n") (" " . "\\\\ ")) get-buffer-create " *w3-latex-munging*" erase-buffer str re-search-forward nil t replace-match w3-latex-replace-entities buffer-string] 9])
  30. (defalias 'w3-latex-ignore #[(tree) "
  31. " [nil] 1])
  32. (defalias 'w3-latex-contents #[(tree) "
  33. " [tree contents w3-latex-subtree nil] 3])
  34. (defalias 'w3-latex-html #[(tree) "
  35. " ["% This document automatically generated by Emacs-W3 v" w3-version-number "\n" w3-latex-current-url "% from <URL:" ">\n" "%\n" "\\batchmode\n\\begin{document}\n" "\\setlength{\\parindent}{0pt}\n" "\\setlength{\\parskip}{1.5ex}\n" "\\newcommand{\\nullspace}{\\rule{0pt}{0pt}}" w3-latex-contents tree w3-latex-links-list w3-latex-endnotes "\\end{document}\n"] 3])
  36. (defalias 'w3-latex-title #[(tree) "
  37. " [w3-latex-use-maketitle "\\title{" "\\section*{\\centering " w3-latex-contents tree "}\n" "\\author{}\\date{}\n\\maketitle"] 2])
  38. (defalias 'w3-latex-heading #[(tree) "
  39. " [align tree sym "\n\n" "center" "\\begin{center}\n" "right" "\\begin{flushright}\n" h1 "\\section*{" h2 "\\subsection*{" h3 "\\subsubsection*{" h4 h5 "\\paragraph*{" h6 "\\subparagraph*{" w3-latex-contents "}\n" "\\end{center}\n" "\\end{flushright}\n"] 2])
  40. (defalias 'w3-latex-bold #[(tree) "
  41. " ["{\\bf " w3-latex-contents tree "}"] 2])
  42. (defalias 'w3-latex-italic #[(tree) "
  43. " ["{\\em " w3-latex-contents tree "}"] 2])
  44. (defalias 'w3-latex-typewriter #[(tree) "
  45. " ["{\\tt " w3-latex-contents tree "}"] 2])
  46. (defalias 'w3-latex-list #[(tree) "
  47. " [tree sym ol "enumerate" dl "description" "itemize" list-type "\n\\begin{" "}\n" w3-latex-contents "\n\\end{"] 4])
  48. (defalias 'w3-latex-list-item #[(tree) "
  49. " [tree sym dt "\n\\item[" dd "\n\\item" w3-latex-contents "]"] 3])
  50. (defalias 'w3-latex-center #[(tree) "
  51. " ["\\begin{center}" w3-latex-contents tree "\\end{center}"] 2])
  52. (defalias 'w3-latex-rule #[(tree) "
  53. " ["\n\\par\\noindent\\rule{\\textwidth}{.01in}\n"] 1])
  54. (defalias 'w3-latex-para #[(tree) "
  55. " [align tree "center" w3-latex-center "right" "\\begin{flushright}" w3-latex-contents "\\end{flushright}" "\\par "] 3])
  56. (defalias 'w3-latex-quote #[(tree) "
  57. " ["\\begin{quote}\n" w3-latex-contents tree "\\end{quote}\n"] 2])
  58. (defalias 'w3-latex-break #[(tree) "
  59. " ["\\newline "] 1])
  60. (defalias 'w3-latex-endnotes #[nil "
  61. " [1 i "\\begin{thebibliography}{99}\n" w3-latex-links-list "\\bibitem{ref" number-to-string "}" w3-latex-insert-string "\n" "\\end{thebibliography}\n"] 3])
  62. (defalias 'w3-latex-href #[(tree) "
  63. " [href tree name w3-latex-print-links w3-latex-contents "\\label{" "}" char-equal ?\# 0 " (see page~\\pageref{" 1 nil "})" footnote "\\footnote{" w3-latex-insert-string w3-latex-links-list i mem append "~\\cite{ref" number-to-string] 5])
  64. (defalias 'w3-latex-preformatted #[(tree) "
  65. " [t w3-latex-verbatim "\\par\\noindent\\begin{tt}" w3-latex-contents tree "\\end{tt}\\par"] 2])
  66. (defalias 'w3-latex-xmp #[(tree) "
  67. " ["\\begin{verbatim}" w3-latex-contents tree "\\end{verbatim}"] 2])
  68. (byte-code "
  69. " [((title . w3-latex-title) (html . w3-latex-html) (pre . w3-latex-preformatted) (xmp . w3-latex-xmp) (h1 . w3-latex-heading) (h2 . w3-latex-heading) (h3 . w3-latex-heading) (h4 . w3-latex-heading) (h5 . w3-latex-heading) (h6 . w3-latex-heading) (a . w3-latex-href) (strong . w3-latex-bold) (b . w3-latex-bold) (dfn . w3-latex-bold) (em . w3-latex-italic) (i . w3-latex-italic) (address . w3-latex-italic) (code . w3-latex-typewriter) (samp . w3-latex-typewriter) (tt . w3-latex-typewriter) (kbd . w3-latex-typewriter) (var . w3-latex-typewriter) (ol . w3-latex-list) (dl . w3-latex-list) (ul . w3-latex-list) (menu . w3-latex-list) (dir . w3-latex-list) (li . w3-latex-list-item) (dt . w3-latex-list-item) (dd . w3-latex-list-item) (center . w3-latex-center) (hr . w3-latex-rule) (p . w3-latex-para) (br . w3-latex-break) (blockquote . w3-latex-quote)) todo put w3-latex-formatter] 5)
  70. (defalias 'w3-latex-subtree #[(tree) "
  71. " [tree w3-latex-insert-string w3-latex-formatter proc fboundp w3-latex-contents] 3])
  72. (defalias 'w3-parse-tree-to-latex #[(tree &optional url) "
  73. \n\"\"c
  74. " [get-buffer-create url-working-buffer url w3-latex-current-url erase-buffer w3-latex-use-latex2e "\\documentclass" w3-latex-docstyle "\n" "\\documentstyle" w3-latex-packages apply concat mapcar #[(x) "
  75. " ["\\usepackage{" x "}\n"] 3] tree w3-latex-subtree nil] 6])
  76. #@67 Uses xdvi to show DVI file created from `w3-parse-tree-to-latex'.
  77. (defalias 'w3-show-dvi #[nil "
  78. " [w3-parse-tree-to-latex w3-current-parse ((byte-code "
  79. " [url-working-buffer write-region expand-file-name "w3-tmp.latex" w3-temporary-directory nil 5 shell-command format "(cd %s ; latex w3-tmp.latex ; latex w3-tmp.latex ; xdvi w3-tmp.dvi ; rm -f w3-tmp*) &"] 6))] 2 (#$ . 8234) nil])
  80. (provide 'w3-latex)
  81.